package de.hsos.bose.skillshare.model.objects;

public class Mitarbeiter extends SkillShareDBObject {
	
	private int id;
	private String vorname;
	private String name;
	private String beruf;
	private String anschrift;
	private String zipcode;
	private String city;
	private String login;
	private String passwort;
	private int rollID;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getVorname() {
		return vorname;
	}
	public void setVorname(String vorname) {
		this.vorname = vorname;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getRollID() {
		return rollID;
	}
	public void setRollID(int rollID) {
		this.rollID = rollID;
	}
	public String getBeruf() {
		return beruf;
	}
	public void setBeruf(String beruf) {
		this.beruf = beruf;
	}
	public String getLogin() {
		return login;
	}
	public void setLogin(String login) {
		this.login = login;
	}
	public String getPasswort() {
		return passwort;
	}
	public void setPasswort(String passwort) {
		this.passwort = passwort;
	}
	
	public String toName() {
		StringBuilder builder = new StringBuilder();
		builder.append(name);
		builder.append(", ");
		builder.append(vorname);
		return builder.toString();
	}
	
	public boolean hasLogin(){
		if(login == null || passwort == null || rollID == 0){
			return false;
		}else{
			if(login.isEmpty() || passwort.isEmpty()){
				return false;
			}
		}
		return true;
	}
	
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append(id);
		builder.append(" / ");
		builder.append(vorname);
		builder.append(" / ");
		builder.append(name);
		builder.append(" / ");
		builder.append(beruf);
		builder.append(" / ");
		builder.append(login);
		builder.append(" / ");
		builder.append(passwort);
		builder.append(" / ");
		builder.append(rollID);
		return builder.toString();
	}
	
	public Object[] createUserDataObject() {
		Object[] objArr = new Object[7];
		objArr[0] = id;
		objArr[1] = vorname;
		objArr[2] = name;
		objArr[3] = beruf;
		objArr[4] = login;
		objArr[5] = passwort;
		objArr[6] = rollID;
		return objArr;
	}
	public String getAnschrift() {
		return anschrift;
	}
	public void setAnschrift(String anschrift) {
		this.anschrift = anschrift;
	}
	public String getZipcode() {
		return zipcode;
	}
	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
}
